import {instance} from './index';

const ACCESS_TOKEN = '355330fd3280fe5a9c051be2ef7fac2490c8aa023685e325559b2c979348b7f7';
const WEB_HOOK = '/api/dingtalk/robot/send';
// http://crm-ty.app.test/api/dingtalk/robot/send

const callDintTalkApi = (data) => {
  return instance.post(`${WEB_HOOK}?access_token=${ACCESS_TOKEN}`, data);
}

export const sendMarkdownMessage = (content) => {
  return callDintTalkApi({
    msgtype: 'markdown',
    markdown: {
      title: '建档通知',
      text: content
    }
  });
}
